﻿<%@ Page Title="" Language="C#" MasterPageFile="~/template.master" AutoEventWireup="true"
    CodeFile="manter_cardapios.aspx.cs" Inherits="manter_cardapio" %>

<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="Server">
    <div id="col2">
        <div id="conteudo">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel2" runat="server">
                <ProgressTemplate>
                  <div style="font-family:Arial;font-size:14x;color:Purple"> Processando...
                  <img src="loading.gif" alt="loading" />
                  </div>
                </ProgressTemplate>
            </asp:UpdateProgress>            
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <div>
                        <table>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label1" runat="server" Text="Descrição"></asp:Label>
                                    <asp:TextBox ID="txt_descricao" runat="server"></asp:TextBox>
                                </td>
                                <td align="right">  
                                    <input id="File1" type="file" />                               
                                </td>    
                            </tr> 
                            <tr>                                
                            </tr>                            
                            <tr>
                                <td></td>
                                <td align="right"><asp:Button ID="salvar" runat="server" Text="Salvar Dados" OnClick="cadastrarCardapio" /></td>
                            </tr>
                        </table>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="salvar" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <div>
                        <asp:GridView runat="server" ID="gridCardapios" AutoGenerateColumns="False" EnableViewState="False"
                            OnRowEditing="editarCardapio" OnRowUpdating="atualizarCardapio"
                            OnRowCancelingEdit="cancelarCardapio">
                            <Columns>
                                <asp:BoundField DataField="idcardapio" HeaderText="ID Cardapio" />                               
                                <asp:BoundField DataField="descricao" HeaderText="Descrição" />

                                <asp:CommandField HeaderText="Editar" ShowEditButton="True" ShowHeader="True" EditText="Editar"
                                    UpdateText="Atualizar" CancelText="Cancelar" />
                                <asp:CommandField HeaderText="Deletar" ShowDeleteButton="true" ShowHeader="True"
                                    DeleteText="Excluir" />
                            </Columns>
                        </asp:GridView>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
